#include "Screen.h"

Screen::Screen() : list_size(15)
{
	/*err_message[LOADFAIL] = "File error";
	err_message[SAVEFAIL] = "Data save error";
	err_message[ADDFAIL] = "Data format does not suitable";
	err_message[SEARCHFAIL] = "Data does not exist";
	err_message[DATAEMPTY] = "List empty";*/
}

Screen::~Screen()
{
}

bool Screen::printLogo()
{

	return true;
}

bool Screen::printError(int mode)
{
	cout << err_message[mode] << endl;
	return true;
}

bool Screen::printTable() 
{

}

bool Screen::printData(const DataTable& rhs)
{
	system("cls");
	cout << "Record date : " << rhs.date << "\n\n"
		<< "<Category  - " << rhs.category << '\n'
		<< "<Title     - " << rhs.title << '\n'
		<< "<Author    - " << rhs.author << '\n'
		<< "<Publisher - " << rhs.publisher << '\n'
		<< "<-Memo->\n" << rhs.memo << endl;
	return true;
}

void gotoxy(int row, int col)
{
	COORD pos = {col, row};

	HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);

	SetConsoleCursorPosition(output, pos);
}

